package com.topvision.gsj.launcher;

import android.app.Activity;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;

/**
 * 
* <p>Title: SplashActivity</p>
* <p>Description:app应用入口 </p>
* <p>Company: topvision</p>
* @author    jackGu
* @date       2016-4-27
 */
public class SplashActivity extends Activity {

    @Override  
    public void onCreate(Bundle icicle) {  
        super.onCreate(icicle);
        //去除标题栏
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFormat(PixelFormat.RGBA_8888);  
        setContentView(R.layout.activity_splash);  
    	//开机画面启动2秒
		new Handler().postDelayed(new Runnable() {
			public void run() {
				startTrip();
			}
		}, 2000); 
       
    }
    
    
    
    /**
     * 
    * <p>Title: startTrip</p>
    * <p>Description:启动头部控制service,并跳转到launcher页面 </p>
     */
    private void startTrip(){
    	//HeadTrackUtil.startHeadTrack(this);
    	//获取设备的参数（状态栏的高度，因为跟踪点无法在状态栏之上）
    	viewInited();
    	//跳转到主界面
    	Intent mainIntent = new Intent(this, LauncherActivity.class); 
    	startActivity(mainIntent);  
    	finish();
    }
    
    
    
    /**
     * 设置状态TopWindowServiceEpson.statusBarHeight值
    * <p>Title: viewInited</p>
    * <p>Description:根据屏幕大小获取状态栏的高度,并给TopWindowServiceEpson得statusBarHeight设置值 </p>
     */
	private void viewInited() {  
        Rect rect = new Rect();  
        Window window = getWindow();  
        window.getDecorView().getWindowVisibleDisplayFrame(rect);
        int statusBarHeight = rect.top; 
    	//TopWindowServiceEpson.setStatusbarHeight(statusBarHeight);

    }
    

}
